package com.quyeying.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 商品分类
 * </p>
 *
 * @author skx
 * @since 2022-10-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("tbl_product_category")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TblProductCategoryEntity extends Model<TblProductCategoryEntity> {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 商家id
     */
    private Long merchantId;

    /**
     * 类别图标
     */
    private String categoryImage;

    /**
     * 类别名称
     */
    private String categoryName;

    /**
     * 类别描述
     */
    private String categoryDesc;

    /**
     * 层级
     */
    private Integer level;

    /**
     * 排序值
     */
    private Integer sort;

    /**
     * 父节点id，0为一级分类
     */
    private Long parentId;

    /**
     * 是否删除 0否 1是
     */
    @TableLogic(value = "0", delval = "1")
    private Integer deleted;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @TableField(exist = false)
    private List<TblProductCategoryEntity> children;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
